package com.Threecharacters.inherit_.Super;

public class A {//B的父类
    public int n1 = 100;
    protected int n2 = 200;
    int n3 = 300;
    private int n4 = 400;

    public A(int n1, int n2, int n3, int n4) {
        this.n1 = n1;
        this.n2 = n2;
        this.n3 = n3;
        this.n4 = n4;
        System.out.println(n1 + " " + n2 + " " + n3 + " " + n4);
    }

    public A(){
        System.out.println("A");
    }

    public void test100(){
        ;
    }

    protected void test200(){
        ;
    }

    void test300(){
        ;
    }

    private void test400(){

    }
}

class B extends A{

    public int n5 = 99;

//    public B(int n) {
//        super(10, 20, 30, 40);
//        this.n1 = n;
//        System.out.println(n + " ");
//    }

    public void f1(){
        System.out.println(super.n1);//super访问
        this.n1 = super.n1;
        System.out.println(this.n1);//this访问
    }


    public void say(){
//        super();//这行代码报错，说明super只能在构造器中调用
        System.out.println(super.n1);
        System.out.println(super.n2);
        System.out.println(super.n3);
        super.test100();
        super.test200();
        super.test300();


    }

}
